package oj;

import java.util.Scanner;

public class Test1 {
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextLine()) {
            String s = scanner.nextLine();
            String[] strings = s.split(" ");             //以空格进分割数组接收
            System.out.println(strings[strings.length - 1].length());//求数组最后一个元素的长度
        }
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextLine()) {
            String s = scanner.nextLine();
            int k = s.lastIndexOf(" ");//找到最后一个空格的位置
            String s1 = s.substring(k+1);//从空格后面截取字符串
            System.out.println(s1.length());
        }
    }
}